package br.com.absolutech.study.chapter6.pag267;

import java.text.DateFormat;
import java.text.ParseException;
import java.util.Date;

public class Dates3 {

	public static void main(String[] args) {

		Date d1 = new Date(1000000000000L);
		System.out.println("1st date " + d1.toString());

		DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT);
		String s = df.format(d1);
		System.out.println(s);

		try {
			Date d2 = df.parse(s);
			System.out.println("parsed = " + d2.toString());
		} catch (ParseException e) {
			e.printStackTrace();
		}
		System.out.println("parse exec");

	}
}
